Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delay driving spindle_enable_pin until we get its polarity setting #136

Open
wants to merge 1 commit into
base: edge
Choose a base branch
from

Conversation

realthunder
Copy link

I happen to have an active low triggered relay for controlling the spindle. I found out that every time the board resets, the spindle gets turned on for about one second or so. Digging into the code, I was surprised to find out that all of the G2 pins are initialized in static object constructor! Will there be any safety concern, for example, the spindle enable pin here? I think at least we shall delay driving all output pins with configurable polarity until we get the settings.

Right now, Due doesn't have any persistent storage. So for things like spindle enable, I have to change the default settings and compile a customized image. But then, motate currently have no way to initialize output pin value before actually driving the output. I could have patched motate to add that functionality. But I think it is better to delay driving the output pin until we called config_init(), in case we add the persistent storage in the future.

Delay driving spindle enable output pin until we get its polarity
setting from config. Otherwise, for active low enable, the spindle
gets turned on each time the board resets.
@giseburt giseburt self-requested a review July 17, 2018 02:47
@giseburt giseburt self-assigned this Jul 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants